<%#
 Copyright (C) 2017 Jian Chang <aa65535@live.com>
 Licensed to the public under the GNU General Public License v3.
-%>

<% include("cbi/map") %>

<script type="text/javascript">//<![CDATA[
	(function() {
		var elements = {
			ss_redir: document.getElementById("_redir_status"),
			ss_local: document.getElementById("_local_status"),
			ss_tunnel: document.getElementById("_tunnel_status"),
		};
		XHR.poll(5, "<%=luci.dispatcher.build_url("admin", "services", "shadowsocks", "status")%>", null, function(x, status) {
			for (var k in elements) {
				if (elements[k]) {
					elements[k].textContent = status[k] ? "<%:RUNNING%>" : "<%:NOT RUNNING%>";
				}
			}
		});
	}());
//]]></script>
